package com.ruoyi.pets.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pets.mapper.PetCommunityCommentMapper;
import com.ruoyi.pets.domain.PetCommunityComment;
import com.ruoyi.pets.service.IPetCommunityCommentService;

/**
 * 宠物社区评论Service业务层处理
 * 
 * @author isc
 * @date 2024-03-11
 */
@Service
public class PetCommunityCommentServiceImpl implements IPetCommunityCommentService 
{
    @Autowired
    private PetCommunityCommentMapper petCommunityCommentMapper;

    /**
     * 查询宠物社区评论
     * 
     * @param id 宠物社区评论主键
     * @return 宠物社区评论
     */
    @Override
    public PetCommunityComment selectPetCommunityCommentById(Long id)
    {
        return petCommunityCommentMapper.selectPetCommunityCommentById(id);
    }

    /**
     * 查询宠物社区评论列表
     * 
     * @param petCommunityComment 宠物社区评论
     * @return 宠物社区评论
     */
    @Override
    public List<PetCommunityComment> selectPetCommunityCommentList(PetCommunityComment petCommunityComment)
    {
        return petCommunityCommentMapper.selectPetCommunityCommentList(petCommunityComment);
    }

    /**
     * 新增宠物社区评论
     * 
     * @param petCommunityComment 宠物社区评论
     * @return 结果
     */
    @Override
    public int insertPetCommunityComment(PetCommunityComment petCommunityComment)
    {
        petCommunityComment.setCreateTime(DateUtils.getNowDate());
        return petCommunityCommentMapper.insertPetCommunityComment(petCommunityComment);
    }

    /**
     * 修改宠物社区评论
     * 
     * @param petCommunityComment 宠物社区评论
     * @return 结果
     */
    @Override
    public int updatePetCommunityComment(PetCommunityComment petCommunityComment)
    {
        petCommunityComment.setUpdateTime(DateUtils.getNowDate());
        return petCommunityCommentMapper.updatePetCommunityComment(petCommunityComment);
    }

    /**
     * 批量删除宠物社区评论
     * 
     * @param ids 需要删除的宠物社区评论主键
     * @return 结果
     */
    @Override
    public int deletePetCommunityCommentByIds(Long[] ids)
    {
        return petCommunityCommentMapper.deletePetCommunityCommentByIds(ids);
    }

    /**
     * 删除宠物社区评论信息
     * 
     * @param id 宠物社区评论主键
     * @return 结果
     */
    @Override
    public int deletePetCommunityCommentById(Long id)
    {
        return petCommunityCommentMapper.deletePetCommunityCommentById(id);
    }
}
